#ifndef BCMC_CNC_RTL_RUNTIME_ENVIRONMENT_H
#define BCMC_CNC_RTL_RUNTIME_ENVIRONMENT_H

#include <bcm/bcm.h>
// provided interface
#include "bcmi_enventities.h"
#include "rte.h"

namespace cnc {

	namespace rtl {

		class BCMC_RuntimeEnvironment :
			public bcm::Identifier<bcm::Component>,
			protected bcm::Identifier<BCMI_EnvironmentEntities>,
			protected RuntimeEnvironment
		{
		protected:
			BCMC_RuntimeEnvironment() :
				bcm::Identifier<bcm::Component>("rte", "Runtime Environment"),
				bcm::Identifier<BCMI_EnvironmentEntities>("enventities", "Environment Entities")
				{}
		protected: // bcm::Component
			virtual bcm::IdentifierData *getProvidedInterfaceTable()
			{
				static bcm::IdentifierData idData[] = {
					{ "enventities", "Environment Entities" },
					{ 0, 0 }
				};
				return idData;
			}
			virtual bcm::IdentifierData *getRequiredInterfaceTable()
			{
				static bcm::IdentifierData idData[] = {
					{ 0, 0 }
				};
				return idData;
			}
			virtual bcm::Interface *getInterface(const char *id)
			{
				if (std::string("enventities") == id)
					return static_cast<BCMI_EnvironmentEntities *>(this);
				return 0;
			}
			virtual bool setInterface(Interface *iface)
			{
				return false;
			}
		public:
			static BCMC_RuntimeEnvironment &instance()
			{
				static BCMC_RuntimeEnvironment object;
				return object;
			}
		};

	} // namespace rtl

} // namespace cnc

#endif

